<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>

<%@ taglib uri="/WEB-INF/sapfree-info.tld" prefix="sap" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="login,regist second">
<meta http-equiv="description" content="This is professionalmodule regist page">
<title>我的飞客-注册-技术专长</title>
<link href="../include/styleBase/css/ostable.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/leftPage.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/styleBase.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/messageType.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/exchangeType.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/userType.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/headfoot.css" rel="stylesheet"></link>
<link href="../include/styleBase/css/fontStyle.css" rel="stylesheet"></link>


<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 20px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>

<%
String contextpath = request.getContextPath();
System.out.println("----------------------------------------------------------------------------------------");
String personuuid = (request.getAttribute("personuuid")==null)?"":request.getAttribute("personuuid").toString();
String nextaction = (request.getAttribute("nextaction")==null)?"":request.getAttribute("nextaction").toString();
String nextactionurl = "";
String preactionurl = "";
if("module".equals(nextaction)){
//由业务模块跳转的，下一步为项目经验
	//nextactionurl = request.getContextPath()+"/regist/registservlet?method=setProject";
	nextactionurl = request.getContextPath()+"/regist/registservlet?method=joinQuan&nextaction=setProject";
	preactionurl = request.getContextPath()+"/regist/registservlet?method=setModule";
}else if("project".equals(nextaction)){
//由项目经验跳转的，下一步为信息确认
	//nextactionurl = request.getContextPath()+"/regist/registservlet?method=confirmInfo";
	nextactionurl = request.getContextPath()+"/regist/registservlet?method=joinQuan&nextaction=confirmInfo";
	preactionurl = request.getContextPath()+"/regist/registservlet?method=setProject";
}
//根据人员业务模块，展现相应的圈子
String personmodules = (request.getAttribute("personmodules")==null)?"":request.getAttribute("personmodules").toString();
%>
</head>
<body>
<form name="frm" method="post">
<input type="hidden" name="personuuid" value="<%=personuuid%>">
<table border="0" cellspacing="20" cellpadding="0" bgcolor="#CCCCCC" width="800" align="center">
<tr>
		<td width="958" height="200" bgcolor="#FFFFFF" valign="top">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
        	<tr>
            	<td width="50%" align="center">
		        <img src="../images/logo.jpg" border="0">                </td>
                <td width="50%">
              	</td>
          	</tr>
            <tr>
            	<td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center"><tr id="module1" style="display:block"><td height="40" align="left"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center">
                  <tr>
                    <td colspan="6" height="20"></td>
                  </tr>
                  <tr>
                    <td align="CENTER" height="40" colspan="8"><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        <tr>
                          <td class="tip">您的邀请人信息如下，是否加他为好友？</td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                  	<td colspan="6" height="40">
                  	</td>
                  </tr>
                  <tr>
                    <td align="CENTER" height="40" colspan="8"><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        <tr>
                          <td class="tip">您的邀请人加入了XX个圈子，如果您要加入，请点击圈子图标或者名称：</td>
                        </tr>
                    </table></td>
                  </tr>
                  
                  <tr>
                  	<td colspan="6">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <%
					int quancount = 0;
					String quanuuid = "";
					%>
                    <sap:QuanList filterName="<%=personmodules%>" count="5">
                    <%
					if(quancount%2==0){
						quancount++;
					%>
                    	<tr>
                    	<sap:Quan>
                        <td width="50%">
                        	<table border="0" cellpadding="0" cellspacing="0" width="99%" align="center">
                            	<tr><td rowspan="3" width="90" height="30" style= "position:relative "><img src="<%=contextpath%><sap:write property='QUAN_YSZHAOPIAN'/>" width="90px" height="90px" style="cursor:hand;" onClick="_quanselected('<sap:write property='QUAN_CODE'/>')">
                                <div id="quanselected<sap:write property='QUAN_CODE'/>" style="position:absolute; top:0; left:0;display:none;"><img src="<%=contextpath%>/images/right.png"></div> 

                                </td>
                            	  <td>&nbsp;</td>
                            	  <td height="30"><input type="checkbox" name="quanuuid" value="<sap:write property='QUAN_UUID'/>" id="quanuuid_<sap:write property='QUAN_CODE'/>"><sap:write property="QUAN_NAME"/>（<sap:write property="QUAN_MEMBERCOUNT"/>）</td></tr>
                                <tr>
                                  <td class="blackNormal12">&nbsp;</td>
                                  <td height="30" class="blackNormal12">圈主：<sap:write property="QUAN_OWNERNAME"/></td></tr>
                                <tr>
                                  <td class="blackNormal12">&nbsp;</td>
                                  <td height="30" class="blackNormal12"><sap:write property="QUAN_MEMO"/></td></tr>
                            </table>                        </td>
                        </sap:Quan>
                    <%
					}else{
					%>
                    	<sap:Quan>
                        <td width="50%">
	                        <table border="0" cellpadding="0" cellspacing="0" width="99%" align="center">
                            	<tr><td rowspan="3" width="90" height="30" style= "position:relative "><img src="<%=contextpath%><sap:write property='QUAN_YSZHAOPIAN'/>" width="90px" height="90px" style="cursor:hand;" onClick="_quanselected('<sap:write property='QUAN_CODE'/>')">
                                <div id="quanselected<sap:write property='QUAN_CODE'/>" style="position:absolute; top:0; left:0;display:none;"><img src="<%=contextpath%>/images/right.png"></div></td>
                            	  <td>&nbsp;</td>
                            	  <td height="30"><input type="checkbox" name="quanuuid" value="<sap:write property='QUAN_UUID'/>" id="quanuuid_<sap:write property='QUAN_CODE'/>"><sap:write property="QUAN_NAME"/>（<sap:write property="QUAN_MEMBERCOUNT"/>）</td></tr>
                                <tr>
                                  <td class="blackNormal12">&nbsp;</td>
                                  <td height="30" class="blackNormal12">圈主：<sap:write property="QUAN_OWNERNAME"/></td></tr>
                                <tr>
                                  <td class="blackNormal12">&nbsp;</td>
                                  <td height="30" class="blackNormal12"><sap:write property="QUAN_MEMO"/></td></tr>
                            </table>                        </td>
                        </sap:Quan>
                        </tr>
                    <%
					}
					%>
                    </sap:QuanList>
                      <tr style="display:block">
                        <td align="right">&nbsp;</td>
                        <td height="40" colspan="2" align="right" class="blackNormal14">&nbsp;</td>
                        <td colspan="3" align="left" class="blackNormal14">&nbsp;</td>
                      </tr>
                      <tr style="display:block">
                        <td height="40" colspan="8" align="right">
                        <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        	<tr>
                          		<td class="tip">您的邀请人有XXX个好友，如果您也要加为好友，请点击头像或姓名：</td>
                        	</tr>
                    	</table>                    	</td>
                        <td colspan="3" align="left" class="blackNormal14">&nbsp;</td>
                      </tr>
                      <tr style="display:block">
                        <td height="40" colspan="3" align="right">
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        	<%
							int membercount = 0;
							%>
                        	<sap:MemberList quanuuid="" modulename="<%=personmodules%>">
                            <%
							if(membercount%5==0){
							%>
                            	<sap:Member>
                            	<tr>
                                	<td width="20%">
                                    <table border="0" cellpadding="0" cellspacing="0" width="98%">
                                    	<tr>
                                        	<td align="center"  style= "position:relative "><img src="<%=contextpath%><sap:write property='PI_YSZHAOPIAN' />" width="60" height="60" style="cursor:hand;" onClick="_friendselected('<sap:write property='PI_UUID'/>')">
                                        	  <div id="friendselected<sap:write property='PI_UUID'/>" style="position:absolute; top:0; left:0;display:none;"><img src="<%=contextpath%>/images/right.png"></div>                                           	
                                            </td>
                                        </tr>
                                        <tr>
                                        	<td align="center" class="lightBlueNormal12" height="35">
                                            	<input type="checkbox" name="frienduuid" value="<sap:write property='PI_UUID'/>" id="frienduuid_<sap:write property='PI_UUID'/>">
                                                <sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                                            </td>
                                        </tr>
                                    </table>
                                    </td>
                                </sap:Member>
                            <%
							}else if(membercount%5==4){
							%>
                            	<sap:Member>
                            		<td width="20%">
                                    <table border="0" cellpadding="0" cellspacing="0" width="98%">
                                    	<tr>
                                        	<td align="center"  style= "position:relative "><img src="<%=contextpath%><sap:write property='PI_YSZHAOPIAN' />" width="60" height="60" style="cursor:hand;" onClick="_friendselected('<sap:write property='PI_UUID'/>')">
                                        	  <div id="friendselected<sap:write property='PI_UUID'/>" style="position:absolute; top:0; left:0;display:none;"><img src="<%=contextpath%>/images/right.png"></div>                                           	
                                            </td>
                                        </tr>
                                        <tr>
                                        	<td align="center" class="lightBlueNormal12" height="35">
                                            	<input type="checkbox" name="frienduuid" value="<sap:write property='PI_UUID'/>" id="frienduuid_<sap:write property='PI_UUID'/>">
                                                <sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                                            </td>
                                        </tr>
                                    </table>
                                    </td>
                                </tr>
                                </sap:Member>
                            <%
							}else{
							%>
                            	<sap:Member>
                            	<td width="20%">
                                    <table border="0" cellpadding="0" cellspacing="0" width="98%">
                                    	<tr>
                                        	<td align="center"  style= "position:relative "><img src="<%=contextpath%><sap:write property='PI_YSZHAOPIAN' />" width="60" height="60" style="cursor:hand;" onClick="_friendselected('<sap:write property='PI_UUID'/>')">
                                        	  <div id="friendselected<sap:write property='PI_UUID'/>" style="position:absolute; top:0; left:0;display:none;"><img src="<%=contextpath%>/images/right.png"></div>                                           	
                                            </td>
                                        </tr>
                                        <tr>
                                        	<td align="center" class="lightBlueNormal12" height="35">
                                            	<input type="checkbox" name="frienduuid" value="<sap:write property='PI_UUID'/>" id="frienduuid_<sap:write property='PI_UUID'/>">
                                                <sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                </sap:Member>
                            <%
							}
							membercount++;
							%>
                            </sap:MemberList>
                        </table>
                        </td>
                        <td colspan="3" align="left" class="blackNormal14">&nbsp;</td>
                      </tr>
                      <tr id="areatitle" style="display:block">
                        <td width="50%" align="right">&nbsp;</td>
                        <td height="40" colspan="2" align="right" class="blackNormal14">&nbsp;</td>
                        <td colspan="3" align="left" class="blackNormal14">&nbsp;</td>
                      </tr>
                      </table>
                  </td>
                  </tr>
                  <tr>
                    <td height="40" colspan="6" align="center"><table border="0" cellpadding="0" cellspacing="0" width="257">
                        <tr>
                          <td width="128" align="center"><table border="0" cellpadding="0" cellspacing="0" width="87%">
                              <tr>
                                <td width="101" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_next('<%=preactionurl%>')"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">＜＜上一步</span></a></td>
                              </tr>
                          </table></td>
                          <td width="41">&nbsp;</td>
                          <td width="112" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_next('<%=nextactionurl%>')"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">继续 ＞＞</span></a></td>
                        </tr>
                    </table></td>
                    <td width="1%" height="40" align="center"></td>
                  </tr>
                  <tr>
                    <td height="30" colspan="6" class="orangeNormal14" align="right"><a href="#" onClick="_next('<%=nextactionurl%>')">+跳过</a>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td></td>
                    <td height="20"></td>
                  </tr>
                </table></td>
                    </tr>
            	</table>
              </td>
            </tr>
        </table>
        </td> 
  </tr>
   
</table>
<br>
<br>
<br>
</form>
</body>

</html>

<script type="text/javascript" src="../include/styleBase/js/jquery.js"></script>
<script type="text/javascript" src="../include/styleBase/js/style.js"></script>

<script>
var tempRow=0;
var maxRows=0;
function insertRows(module){
	alert("insertRows js");
	var inserttable = document.getElementById("professionalmodule");
	 tempRow=inserttable.rows.length-1;
	 maxRows=tempRow;
	 tempRow=tempRow+1;
	 var Rows=inserttable.rows;//类似数组的Rows
	 alert(Rows);
	 var newRow=inserttable.insertRow(inserttable.rows.length);//插入新的一行
	 var Cells=newRow.cells;//类似数组的Cells
	 for (i=0;i<6;i++)//每行的6列数据
	 {
		  var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
		  newCell.align="center";
		   switch (i)
		   {
		   		case 0: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\">&nbsp;</td>";break;
				case 1: newCell.innerHTML="<td align='center' height='40' class='blueBold14'>"+module+"                    <input type='hidden' name='module' value='"+module+"'></td>";break;
				case 2: newCell.innerHTML="<td height='40' align='center'><input name='free_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 3: newCell.innerHTML="<td height='40' align='center'><input name='waibu_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 4: newCell.innerHTML="<td height='40' align='center'><input name='neibu_"+module+"' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 5: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\">&nbsp;</td>";break;
		   }
	 }
	 maxRows+=1;
}
function delTableRow(rowNum){
if (table1.rows.length >rowNum){
table1.deleteRow(rowNum);
}
}

function _next(url){
	frm.action=url;
	frm.submit();
}

function _quanselected(quan){
	var obj = document.getElementById("quanselected"+quan);
	var objcheck = document.getElementById("quanuuid_"+quan);
	if(obj.style.display == "none"){
		obj.style.display = "block";
	}else{
		obj.style.display = "none";
	}
	
	if(objcheck.checked){
		objcheck.checked = false;
	}else{
		objcheck.checked = true;
	}
}

function _friendselected(friend){
	var obj = document.getElementById("friendselected"+friend);
	var objcheck = document.getElementById("frienduuid_"+friend);
	if(obj.style.display == "none"){
		obj.style.display = "block";
	}else{
		obj.style.display = "none";
	}
	
	if(objcheck.checked){
		objcheck.checked = false;
	}else{
		objcheck.checked = true;
	}
}

	function goPage(url){
		window.parent.$("#mainFrame").attr("src",url);
	}
	function _showModule(){
		document.getElementById("modulesel").style.display="block";
	}
	function _closeModule(){
		document.getElementById("modulesel").style.display="none";
	}
	function _showModuleLine(i){
		document.getElementById("moduletitle").style.display="block";
		document.getElementById("module"+i).style.display="block";
	}
	
	function _hideModule(i){
		document.getElementById("module"+i).style.display="none";
	}
	
	function _showArea(){
		document.getElementById("areasel").style.display="block";
	}
	function _closeArea(){
		document.getElementById("areasel").style.display="none";
	}
	function _showAreaLine(i){
		document.getElementById("areatitle").style.display="block";
		document.getElementById("area"+i).style.display="block";
	}
	
	function _hideArea(i){
		document.getElementById("area"+i).style.display="none";
	}
</script>
